<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css" />
</head>
<style>
    html,
    body {
        background-color: #fff;
    }

    .placeholder_div {
        background-color: #fbf9f9;

    }

    .tab_div {
        padding: 0.8rem;
        background-color: #fff;
        border-bottom: 1px solid #e8e8e8;
    }

    .tab_div .tab_item {
        display: inline-block;
        padding: 0.2rem 0.5rem;
        font-size: 0.6rem;
        color: #565656;
        margin-right: 0.8rem;
        border-radius: 0.2rem;
        border: 1px solid #e8e8e8;
    }

    .tab_active {
        background-color: #f75349;
        color: #fff !important;
        border: none !important;
    }

    .order_div {
        padding: 0 0.8rem;
    }

    .order_div .order_item {
        padding: 1rem;
        border-radius: 1rem;
        box-shadow: 0px 0.1rem 0.7rem 0px rgba(0, 0, 0, 0.07);
        margin-top: 1rem;
    }

    .order_div .order_item .top {
        color: #303030;
        font-size: 0.7rem;
        padding-bottom: 0.7rem;
        margin: 0 0.1rem 0 0.5rem;
        text-align: left;
    }

    .detail_item {
        width: 100%;
    }


    .detail_item {
        line-height: 1.2rem;
        font-size: 0.6rem;
    }

    .detail_item .tou {
        color: #838383;
        width: 4rem;
        float: left;
        display: inline-block;
        text-align: left;
    }

    .detail_item .wei {
        color: #565656;
        display: inline-block;
        width: 11rem;
        text-align: left;
    }

    .none {
        font-size: 0.6rem;
        margin: 1rem 0;
        text-align: center;
    }
</style>

<body>
    <div  id="app" v-cloak>
        <div class="placeholder_div"></div>

        <div class="order_div">

            <div class="order_item" @click="go_paifang_detail_win(item.id, item.status)" v-for="item in list_data">
                <div class="top">
                    <span>{{item.name}}</span>
                    <span v-if="item.status == 0">待药房划价</span>
                    <span v-if="item.status == 1">待生成方案</span>
                    <span v-if="item.status == 2">已生成方案</span>
                </div>
                <p class="detail_item">
                    <span class="tou">药&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;房：</span>
                    <span class="wei p_hide">{{item.store}}</span>
                </p>
                <p class="detail_item">
                    <span class="tou">拍方时间：</span>
                    <span class="wei p_hide">{{item.createTime}}</span>
                </p>
            </div>

        </div>
        <p class="none">已经没有更多了~</p>
    </div>
</body>

</html>
<script src="../script/set_root.js"></script>

<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/zepto.min.js"></script>
<script type="text/javascript" src="../script/hb.js"></script>
<script type="text/javascript" src="../script/vue.js"></script>
<script type="text/javascript">
    apiready = function () {
        hb_ready();

        get_data()
    }
    //使用vue对数据进行绑定
    var app = new Vue({
        el: '#app',
        data: {
            page: 1,
            list_data: [], // 拍方数据
        },
        methods: {
            go_paifang_detail_win: function (id, status) {
                if (status == 0) {
                    api.openWin({
                        name: "paifang_detail_win",
                        url: "paifang_detail_win.html",
                        pageParam: {
                            id: id
                        }
                    })
                } else if (status == 1) {
                    api.openWin({
                        name: "paifang_case_win",
                        url: "paifang_case_win.html",
                        pageParam: {
                            id: id,
                            status: status
                        }
                    })
                }
            }
        },

    })

    function get_data() {
        get_ajax("prescribe/plan-photo/list-doctor", {
            doctorId: $api.getStorage("emp").userId,
            page: app.page,
            pagesize: 10,
        }, function (res, err) {
            if (res.code == 200) {
              //  alert(JSON.stringify(res))
                app.list_data = res.data.data
            } else {
                // alert(JSON.stringify(res))
            }

            app.$nextTick(function () {
                hb_init_openwinby_click();
            })
        })
    }
</script>
